<%@ page contentType="text/html; charset=UTF-8"%>

<%@ page import="java.util.HashMap"%>
<%@ page import="java.util.Map"%>
<%@ page import="java.util.List"%>

<%
String error_code = request.getParameter("error");
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
   <head>
      <meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
      <title>管理系统</title>
      <link href="css/logincss.css" rel="stylesheet" type="text/css" />
   </head>
   
   <body class="loginbg">
      <div class="login-center">
         <div class="loginbg-left">
            <div class="loginUI">
               <div class="loginInput">
                  <div class="box">
                  <form id='login' name='login' action="${pageContext.request.contextPath}/j_spring_security_check" method='post'>
                     <p class="backfont">账　号：<input id="j_username" name="j_username" type="text" class="medium-input input1"  value="admin"/></p>
                     <p class="backfont">密　码：<input id="j_password" name="j_password" type="password" class="medium-input input2" value="123456"/></p>
                     <p class="backfont">验证码：<input id="imagecode" name="imagecode" type="text" class="medium-input input1" /></p>
                     <p class="backfont">
                        <!--
                        <input type="text" name="code" id="textfield3" style="width: 60px;"
                               onkeydown="javascript:fun_key_down(event)">
                        -->
                        <a href="#" style=" margin-right:20px;" onclick="javascript:fun_login_load_image()">看不清，换一张?</a>
                        <img src="code.jsp" alt="忘记密码" align="absbottom" class="help_space"/>
                        
                        <!--
                        <a href="#" style=" margin-right:20px;">看不清，换一张?</a>
                        <img src="images/help_16x16.gif" alt="忘记密码" align="absbottom" class="help_space"/>
                        <a href="#">忘记密码?</a>
                        -->
                     </p>
                     <p align="center">
                        <input name="登 录" type="submit" class="btn" value="登  录" onclick="javascript:checkForm()"/>
                        <input name="重 置" type="reset" class="btn2" value="重  置"/>
                     </p>
                  </form>
                  </div>
               </div>
            </div>
            
            <!--
            <div class="footer">请使用IE（IE8以上）、firefox及Google Chrome等主流浏览器访问本系统,为保证最佳使用效果，推荐使用Google Chrome浏览器，<a href="#">点击安装</a>chrome浏览器
            </div>
            -->
         </div>
      </div>
      
<script type="text/javascript">

   function checkForm()
   {
      var thisForm = document.login;
      //var thisForm = $('form[name=login]')[0];
      
      if(thisForm.j_username.value == null || thisForm.j_username.value == '' || thisForm.j_username.value.length == 0)
      {
         $.messager.alert('操作提示', '用户名不能为空！');
         //thisForm.j_username.focus();
         return ;
      }
      else if(thisForm.j_password.value == null || thisForm.j_password.value == "")
      {
         $.messager.alert('操作提示', '密码不能为空！');
         //thisForm.j_password.focus();
         return ;
      }
      /*
      else if(thisForm.code.value == null || thisForm.code.value == "")
      {
         $.messager.alert('操作提示', '验证码不能为空！');
         //thisForm.code.focus();
         
         return ;
      }
      */
         
      thisForm.submit();
   }

   function fun_key_down(event)
   {  
      var currKey = event.keyCode;
      
      if(currKey == 13)
      {   
         checkForm();
      }
   }
   
   function fun_login_load_image()
   {
      document.getElementById('imagecode').src = './code.jsp?t=' + new Date().getTime();
   }
   
</script>

   </body>
   
</html>
